//
//  CLBuleToothBraceletNetTool.h
//  toroBracelet
//
//  Created by 丁益 on 16/8/17.
//  Copyright © 2016年 celi. All rights reserved.
//  与蓝牙手环通讯工具类

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>
#import "CLBuleToothTool.h"


typedef  void(^scanBuleToothBraceletComplete)(NSArray *array);
typedef  void(^connectBuleToothSuccess)(CBPeripheral *peripheral);

@protocol CLBuleToothBraceletNetToolDelegate <NSObject>

/** 手环有数据上传*/
- (void)buleToothBraceletUpdateValue:(NSData*)Value;

@end

@interface CLBuleToothBraceletNetTool : NSObject

@property (nonatomic, weak) id<CLBuleToothBraceletNetToolDelegate> delegate;

/** 扫描蓝牙手环*/
- (void)scanBuleToothBracelet:(scanBuleToothBraceletComplete)scanSuccess scanFailure:(void(^)(NSError *error))scanFailure;

/** 连接蓝牙手环*/
- (void)connectBuleToothBraceletWithperipheral:(CBPeripheral *)peripheral connectSuccess:(connectBuleToothSuccess)connectSuccess connectFailure:(void(^)(NSError *error))connectFailure;

/** 断开蓝牙手环*/
- (void)cancelBuleToothBracelet;

/** 结束扫描*/
- (void)stopScanBuleToothBracelet;

/** 发送数据*/
- (void)sendWithdata:(NSData *)data;

@end
